<template>
  <div class="rule-dialog">
    <el-dialog
      title="提示"
      width="380px"
      :visible.sync="value"
      :close-on-click-modal="false"
    >
      <div class="zl-dialog-main pr">
        <img
          class="close-img"
          src="//image.zlketang.com/public/news/others/imgs/web_pc/cad5e9c225671b8ff30fe12bfac1e84f.png"
          @click="continueExam"
        />
        <img
          src="//image.zlketang.com/public/news/others/imgs/web_pc/4b470e85eb43a380f0f8355198e88415.png"
          alt=""
          class="main"
        />
        <div class="tip">
          休息一下暂停作答
        </div>

        <div class="flex-center m-t-40">
          <div @click="continueExam" class="default-btn flex-center cu">
            继续做题
          </div>
          <div @click="saveExam" class="primary-btn flex-center cu">
            保存进度并退出
          </div>
        </div>
      </div>
    </el-dialog>
  </div>
</template>

<script>
export default {
  props: {
    value: {
      type: Boolean,
      default: true
    }
  },
  data() {
    return {}
  },
  methods: {
    close() {
      this.$emit('input', false)
    },
    continueExam() {
      this.close()
      this.$emit('continue')
    },
    saveExam() {
      this.$emit('save-and-exit')
    }
  }
}
</script>

<style scoped>
.rule-dialog /deep/ .el-dialog {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  margin: 0 !important;
  border-radius: 12px;
}
.rule-dialog /deep/ .el-dialog__header {
  display: none;
}

.rule-dialog /deep/ .el-dialog__body {
  padding: 0;
}

.zl-dialog-main {
  padding-top: 30px;
  width: 380px;
  height: 234px;
  background-image: url('//image.zlketang.com/public/news/others/imgs/web_pc/479255d3c3565ce1be62dd2edbe140a0.png');
  background-size: 380px 234px;
  background-repeat: no-repeat;
  border-radius: 12px;
}
.main {
  display: block;
  margin: 0 auto;
  width: 180px;
  height: 60px;
}
.tip {
  text-align: center;
  margin-top: 18px;

  height: 24px;
  font-size: 16px;
  font-weight: 400;
  color: #383838;
  line-height: 24px;
}
.default-btn {
  width: 88px;
  height: 32px;
  border-radius: 16px;
  border: 1px solid #d9d9d9;
  font-size: 14px;
  font-weight: 400;
  color: #666666;
}
.primary-btn {
  margin-left: 20px;
  width: 130px;
  height: 32px;
  background: #3480ff;
  border-radius: 16px;

  font-size: 14px;
  font-weight: 400;
  color: #ffffff;
}
.close-img {
  width: 14px;
  height: 14px;
  position: absolute;
  top: 19px;
  right: 19px;
}
</style>
